package me.service.impl;

import me.service.AdminService;
import me.service.FactoryService;
import me.service.StudentService;

/**
 * 用于创建service的工厂实现类
 *
 * @author Rainh
 */
public class FactoryServiceImpl implements FactoryService {


    private static FactoryServiceImpl instance;

    public static FactoryServiceImpl getInstance(){

        if(instance==null){
            instance = new FactoryServiceImpl();
        }

        return instance;
    }

    /**
     * 生产adminService
     * @return
     */
    @Override
    public AdminService createAdminService() {
        return new AdminServiceImpl();
    }

    /**
     * 生产studentService
     * @return
     */
    @Override
    public StudentService createStudentService() {
        return new StudentServiceImpl();
    }
}
